<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view('common/head');?>
<body class="no-skin">
<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal" action="<?php echo site_url(X_URL.'member/update');?>" method="post">
						<?php echo csrf_hidden();?>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 用户名 </label>
                                <div class="col-sm-9">
                                    <input type="text"
                                        <?php if(isset($member) && $member['user_id'] == 1){ ?>
                                        readonly
                                        <?php }else{?>
                                        name="user"
                                        <?php } ?>
                                           class="rcol-xs-10 col-sm-5" value="<?php if(isset($member)){ echo $member["user_name"];}?>">
                                    <input type="hidden" name="user_id" value="<?php if(isset($member)){ echo $member["user_id"];}?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
											<?php if(isset($member) && $member['user_id'] == 1){ ?><span class="middle">无法修改</span><?php } ?>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-10"> 用户组 </label>
                                <div class="col-sm-9">
                                    <?php if(isset($member) && $member['user_id'] == 1){ ?>
                                            <?php foreach ($usergroup as $key => $val) { ?>
                                            <if condition="$val['id'] eq $member['user_group']">
                                                <?php if($val['id'] == $member['user_group']){ ?>
                                                <input type="text" class="col-xs-10 col-sm-5" value="<?php echo $val['title'];?>"
                                                       readonly>
                                                <input type="hidden" name="user_group" id="user_group"
                                                       class="col-xs-10 col-sm-5" value="<?php echo $val['id'];?>">
                                                <?php } ?>
                                            <?php } ?>
                                    <?php }else{?>
                                        <select id="user_group" name="user_group" class="rcol-xs-10 col-sm-5">
                                            <?php foreach ($usergroup as $key => $val) { ?>
                                                <option value="<?php echo $val['id'];?>"
                                                        <?php if(isset($member) && $val['id'] == $member['user_group']){ ?>
                                                            selected="selected"
                                                        <?php } ?>
                                                ><?php echo $val['title'];?></option>
                                            <?php } ?>
                                        </select>
                                    <?php } ?>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">请慎重选择用户组</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 用户密码 </label>
                                <div class="col-sm-9">
                                    <input type="password" name="user_password" id="user_password" placeholder="用户密码"
                                           class="col-xs-10 col-sm-5" value="">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">留空不修改</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-4"> 性别 </label>
                                <div class="col-sm-9">
                                    <select id="user_sex" name="user_sex" class="multiselect">
                                        <option value="0" <?php if(isset($member) && $member['user_sex'] == 0){?>selected="selected"<?php } ?>
                                        >保密</option>
                                        <option value="1" <?php if(isset($member) && $member['user_sex'] == 1){?>selected="selected"<?php } ?>
                                        >男</option>
                                        <option value="2" <?php if(isset($member) && $member['user_sex'] == 2){?>selected="selected"<?php } ?>
                                        >女</option>
                                    </select>
                                </div>
                            </div>

                            <div class="space-4"></div>




                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-6"> 电话号码 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="user_tel" id="user_tel" placeholder="电话号码"
                                           class="col-xs-10 col-sm-5" value="<?php if(!empty($member['user_tel'])){  echo $member['user_tel'];}?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-7"> Q&nbsp;&nbsp;Q </label>
                                <div class="col-sm-9">
                                    <input type="text" name="user_qq" id="user_qq" placeholder="QQ" class="col-xs-10 col-sm-5"
                                           value="<?php if(!empty($member['user_qq'])){  echo $member['user_qq'];}?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-8">
                                    E-mail </label>
                                <div class="col-sm-9">
                                    <input type="email" name="user_email" id="user_email" placeholder="E-mail"
                                           class="col-xs-10 col-sm-5" value="<?php if(!empty($member['user_email'])){ echo $member['user_email'];};?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle"></span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info" type="submit">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->

<?php $this->load->view('common/footerjs');?>
<!-- inline scripts related to this page -->

</body>
</html>
